package com.anjubao.parking.municipal.payment.form;

import com.anjubao.parking.municipal.common.exception.ServiceException;
import com.anjubao.parking.municipal.payment.constant.PayChannelIdEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.util.StringUtils;

/**
 * 支付订单记录表
 *
 * @author zhuchunfeng
 */
@Getter
@Setter
@ApiModel(value="payOrderDto",description = "支付订单")
public class PayOrderForm {

    @ApiModelProperty(value = "子系统业务id",required = true)
    private String businessId;

    @ApiModelProperty(value = "订单编号", required = true)
    private String outTradeNo;

    @ApiModelProperty(value = "1：微信支付 2:支付宝支付 3:银联支付 4:余额支付 5:余额支付 99:其他",required = true)
    private Integer payChannelId;

    public void validate(){
        if (StringUtils.isEmpty(businessId) || StringUtils.isEmpty(outTradeNo)) {
            throw new ServiceException("businessId 或 outTradeNo 不能为空");
        }
    }

}